<div class="esn-right-container">
  <contenthead></contenthead>
  <div class="content-body">
      <deptadmin></deptadmin>
      <deptmemberlist></deptmemberlist>
      <deptlist></deptlist>
  </div>
</div>



<!--//组织负责人模板-->
<script type='text/ng-template' id='deptadmin.html'>
  <div>
      <div class="line-divide-wrapper line-divide-first" ng-click="toggleDisplayClass($event)">
        <div class="table-cell org-table-cell">组织负责人</div>
        <div class="table-cell">
           <div class="triangle triangle-down">
          </div>
        </div>
      </div>
      <div class="content-group-org">
        <div ng-if="!deptadmin" style="text-align: -webkit-center;padding: 8px;">
          暂无组织负责人
        </div>
        <div class="group-wrapper" ng-if="deptadmin && deptadmin[0].member_id">
          <div class="float-item-org" ng-repeat="each in deptadmin" ng-click="userCard(each.member_id,each)">
              <div class="content-cell" style="width:52px">
                <headerphoto item="each"></headerphoto>
                <!-- <img class="headImg" src="{{each.avatar}}" onerror="this.src='src/style/images/avt_default.png'"> -->
              </div>
              <div class="content-cell">
                <div class="people-name">{{each.name}}</div>
                <div class="people-duty" ng-if="each.duty">{{each.duty}}</div>
                <div class="people-duty" ng-if="!each.duty">&nbsp;</div>
              </div>
          </div>
        </div>
      </div>
    </div>
</script>
<!--//组织成员模板-->
<script type='text/ng-template' id='deptmemberlist.html'>
    <div class="deptmemberlist">
        <div class="line-divide-wrapper" ng-click="toggleDisplayClass($event)">
          <div class="table-cell org-table-cell">组织成员</div>
          <div class="table-cell">
            <div class="triangle triangle-down" ></div>
          </div>
        </div>
        <div class="content-group-org">
          <div class="group-wrapper">
            <div ng-if="deptmemberlist.length == 0" style="text-align: -webkit-center;padding: 8px;">
              暂无组织成员
            </div>
            <div class="float-item-org" ng-repeat="each in deptmemberlist" ng-click="userCard(each.member_id,each)">
                <div class="content-cell" style="width:52px">
                  <headerphoto item="each"></headerphoto>
                  <!-- <img class="headImg" src="{{each.avatar}}" onerror="this.src='src/style/images/avt_default.png'"> -->
                </div>
                <div class="content-cell">
                  <div class="people-name" style="">{{each.name}}</div>
                  <div class="people-duty" ng-if="each.duty">{{each.duty}}</div>
                  <div class="people-duty" ng-if="!each.duty">&nbsp;</div>
                </div>
            </div>
          </div>
          <div class="loadingmore">点击加载更多组织成员</div>
        </div>
    </div>
</script>
<!--//下属组织模板-->
<script type='text/ng-template' id='deptlist.html'>
    <div>
          <div class="line-divide-wrapper" ng-click="toggleDisplayClass($event)">
            <div class="table-cell org-table-cell">下属组织</div>
            <div class="table-cell">
            <div class="triangle triangle-down" >
            </div>
            </div>
          </div>
          <div class="content-group sub-org subsidiary">

            <div ng-if="!sub_organization" style="text-align: -webkit-center;padding: 8px;padding-right:21px">
              暂无下属组织
            </div>
            <div ng-repeat="each in sub_organization" class="table-wrapper" ui-sref="main.contact.organization({deptId:each.id,name:each.name})">
              <div class="table-cell org-dept-table-cell">
                  {{each.name}}
              </div>
              <div class="table-cell" style="width:60px">
                  <span>{{each.count}}</span>
              </div>
            </div>
          </div>
    </div>

</script>

<script type='text/ng-template' id='contenthead.html'>
    <div class="content-head esn-org-head">
        <span style="cursor: pointer;" class="esn-org-head-span" ng-repeat="each in deptArray" ng-if="$index < deptArray.length-1" ui-sref="main.contact.organization({deptId:each.deptId,name:each.name})">
        {{each.name +" > "}}
        </span>
        <span  style="cursor: pointer;" class="esn-org-head-span" ng-repeat="each in deptArray" ng-if="$index == deptArray.length-1" ui-sref="main.contact.organization({deptId:each.deptId,name:each.name})">
        {{each.name}}
        </span>
    </div>

</script>
